import Axios from "../../lib/request";

//一级类目
export const firstGoods = function () {
    return Axios.get(`/category/list1`);
};
//二级类目
export const secondGoods = function (id) {
    return Axios.get(`/category/list2/?id=${id}`);
};

//商品SPU获取
export const getCommodityCategory = function (data) {
    return Axios.post("/tbSpu/getCommodityCategory", data);
};
//商品SKU获取
export const getSkus = function (id) {
    return Axios.get(`/tbSku/getSku?spuId=${id}`);
};

//新增进货
export const insertPurchase = function (data) {
    return Axios.post("/inventoryrecords/insertPurchase", data);
};

//删除进货
export const delPurchase = function (id) {
    return Axios.get(`/inventoryrecords/updateStatus?id=${id}`);
};

//修改进货
export const updatePurchase = function (data) {
    return Axios.post("/inventoryrecords/update", data);
};

//进货列表
export const PurchaseList = function (data) {
    return Axios.post("/inventoryrecords/selectCreateTimeSkuName", data);
};

//入库
export const insertEnterAndPL = function (data) {
    return Axios.post("/inventoryrecords/insertEnterAndPL", data);
};

//入库记录列表
export const selectEnter = function (data) {
    return Axios.post("/inventoryrecords/selectEnter", data);
};

//销售记录列表
export const selectMarket = function (data) {
    return Axios.post("/tbOrderdetail/selectmarket", data);
};

//商品库存列表
export const selectTitleStock = function (data) {
    return Axios.post("/inventoryrecords/selectTitleStock", data);
};

//库存损益记录列表
export const selectProfitAndLoss = function (data) {
    return Axios.post("/inventoryrecords/selectProfitAndLoss", data);
};

//库存盘点记录列表 
export const inventorycheckSelectCheck = function (data) {
    return Axios.post("/inventorycheck/selectCheck", data);
};
//添加库存盘点记录
export const inventorycheckInsertIC = function (data) {
    return Axios.post("/inventorycheck/insertIC", data);
};

//库存盘点商品列表获取
export const inventorycheckSelectSkuNum = function () {
    return Axios.get(`/inventorycheck/selectSkuNum`);
};

//删除库存盘点
export const inventorycheckUpdateStatus = function (id) {
    return Axios.get(`/inventorycheck/updateStatus?id=${id}`);
};
//库存盘点新增商品列表
export const selectSkuNum = function (data) {
    return Axios.post(`/inventorycheck/selectSkuNum`,data);
};
//库存盘点详情
export const commoditycheckSelectCommCheck = function (data) {
    return Axios.post("/commoditycheck/selectCommCheck", data);
};

//分店进货审批
export const tInventoryrecordsSelectStatusApp = function (data) {
    return Axios.post("/tInventoryrecords/selectStatusApp", data);
};

//查询店铺
export const userGetStoreList = function () {
    return Axios.get(`/user/getStoreList`);
};

//修改审批状态
export const tInventoryrecordsUpdateStatus = function (data) {
    return Axios.post(`/tInventoryrecords/updateStatus`,data);
};

